feat(lcm): default retag tag to latest, resolving version from the image - #2090
Conversation
📝 WalkthroughWalkthroughThe stable retag workflow now accepts explicit versions or ChangesStable retag workflow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant ContainerRegistry
participant ImageManifest
GitHubActions->>ContainerRegistry: Resolve requested image
ContainerRegistry->>ImageManifest: Read bricks_version label
ImageManifest-->>GitHubActions: Return resolved X.Y.Z version
GitHubActions->>ContainerRegistry: Compare latest and resolved digests when requested
GitHubActions->>ContainerRegistry: Retag M<major>-<cluster> aliases
GitHubActions-->>GitHubActions: Write resolved workflow summary
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
a95fa03 to
a74221c
Compare
The retag workflow derived the major version by string-splitting the tag input, so a 'latest' input would have produced Mlatest-<cluster>. Resolve the concrete version from the image itself instead: the build stamps LABEL bricks_version from the BRICKS_VERSION build-arg, so `crane config | jq .config.Labels.bricks_version` is authoritative and independent of mutable tag names. With that in place, default the tag input to 'latest' — the common case after a promotion — and retag from the resolved version tag rather than from latest, so the run is traceable and cannot tear if latest moves mid-run. When resolving, assert latest and the version tag share a digest; an explicit tag input (rollback) is exempt, since it is expected to differ. Major is now computed per image inside the loop, and the summary reports the requested tag, the resolved version(s), and the clusters actually retagged instead of recomputing a major that no longer exists.
a74221c to
ba68bde
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/lcm-stable-retag.yaml:
- Around line 111-122: Update the version-resolution flow around the TAG/latest
branch so every TAG value, including explicit rollback inputs, is passed through
resolve_version using the bricks_version input; only the latest path should
retain the stable-tag digest comparison. Derive major and src from the resolved
concrete version, and ensure summaries use that same resolved value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 3c6e9815-0af1-481f-a885-923a35be7b63
📒 Files selected for processing (1)
.github/workflows/lcm-stable-retag.yaml
The retag workflow derived the major version by string-splitting the tag input, so a
latestinput would have producedMlatest-<cluster>. This PR resolves the concrete version from the image itself instead: the build stamps LABEL bricks_version from the BRICKS_VERSION build-arg, socrane config | jq .config.Labels.bricks_versionis authoritative and independent of mutable tag names.With that in place, default the tag input to
latest.Summary by CodeRabbit
latesttag.latestmatches the resolved version before retagging.